﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo5
{
	class Program
	{
		 
		static void Main(string[] args)
		{
			Console.WriteLine("请输入正方形的边长");
			int a = int.Parse(Console.ReadLine());
			for (int i = 0; i < a; i++)
			{
				for (int j = 0; j < a; j++)
				{
					if (i == 0 || i == a - 1 || j == 0 || j == a - 1)
					{
						Console.Write("*");
					}
					else
					{
						Console.Write(" ");
					}
				}
				Console.WriteLine();
			}
			Console.ReadLine();
		}
	}
}
